<template>
  <div>
    <el-menu style="height: 100%" :default-active="activeRouter" router>
      <el-menu-item index="/adminManage/adminHome" class="myItem">
        <i class="el-icon-s-home myIcon"></i>
        <span slot="title">首页</span>
      </el-menu-item>
      <el-menu-item index="/adminManage/adminFileManage" class="myItem">
        <i class="el-icon-s-finance myIcon"></i>
        <span slot="title">文件管理</span>
      </el-menu-item>
      <el-menu-item index="/adminManage/adminFileTypeManage" class="myItem">
        <i class="el-icon-menu myIcon"></i>
        <span slot="title">分区管理</span>
      </el-menu-item>
      <el-menu-item index="/adminManage/adminUserInfo" class="myItem">
        <i class="el-icon-user-solid myIcon"></i>
        <span slot="title">个人信息</span>
      </el-menu-item>
      <el-menu-item class="myItem" @click="logout">
        <i class="el-icon-remove myIcon"></i>
        <span slot="title">退出登录</span>
      </el-menu-item>
    </el-menu>
  </div>
</template>

<script>
export default {
  name: "AdminAside",
  data() {
    return {
      activeRouter: "",
    }
  },
  mounted() {
    this.activeRouter = window.location.pathname
  },
  methods: {
    logout() {
      localStorage.removeItem("token");
      this.$router.push("/login");
    }
  }
}
</script>

<style scoped>
.myItem {
  text-align: center;
  font-size: 20px;
}
.myIcon {
  font-size: 18px;
}
</style>
